package commons;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.Timer;
import commands.ICommand;

public class Clock
{
	public static void BattreTempo(final ICommand cmdMarquerTempo, int tempo)
	{
		int delay = 60/tempo;
		Timer timer = new Timer(delay, new ActionListener()
		{
			public void actionPerformed(ActionEvent e)
			{
				cmdMarquerTempo.execute();
			}
		});
		
		timer.setRepeats(true);
	}
}